﻿-- Function: GuardarVentaDetalle(integer, character, integer,integer)

-- DROP FUNCTION GuardarVentaDetalle(integer, character, integer,integer)

CREATE OR REPLACE FUNCTION GuardarVentaDetalle(integer, integer, integer ,float, float )
  RETURNS integer AS
$BODY$

DECLARE
	folio 			ALIAS FOR $1;
	codigo 			ALIAS FOR $2;
	cantidad		ALIAS FOR $3;
	preciounitario		ALIAS FOR $4;
	preciototal		ALIAS FOR $5;

BEGIN
	insert into ventasdetalle(folio,codigo,cantidad,preciounitario,preciototal) values(folio,codigo,cantidad,preciounitario,preciototal);
	return 1;
END;
$BODY$
  LANGUAGE plpgsql VOLATILE
